import request from '@/utils/request'
const apix = 'dev-api'
// api地址
const api = {
	vouchers_list: apix + '/integral/vouchers/list',
	vouchers_export: apix + '/integral/vouchers/export',
	integral_vouchers: apix + '/integral/vouchers',
	// integral_vouchers: apix + '/integral/vouchers',
	integral_vouchersIds: apix + '/integral/vouchers/',
}

//查询兑换券
export function vouchersList(page) {
	return request.get(api.vouchers_list, {
		...page
	})
}
//导出兑换券
export function vouchersExport(obj) {
	return request.post(api.vouchers_export, {
		...obj
	})
}
//获取兑换券详情
export function vouchersId(id) {
	return request.get(api.integral_vouchersIds + id)
}
//新增兑换券
export function addvouchers(obj) {
	return request.post(api.integral_vouchers, {
		obj
	})
}
//修改兑换券
export function putvouchers(obj) {
	return request.put(api.integral_vouchers, {
		...obj
	})
}
//删除兑换券
export function delvouchers(id) {
	return request.delete(api.integral_vouchersIds + id)
}